!function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o 16 / 9){ video.css('width', '105%'); video.css('height', ''); }else{ video.css('width', ''); video.css('height', '105%'); }}); } window.bt_bb_video_callback=function(v){ $(v).parent().addClass('video_on'); } $(document).ready(function (){ bt_bb_video_background(); }); $(window).on('resize', function(e){ bt_bb_video_background(); }); $('a[href*="#"]:not([href="#"])').not('.menu-scroll-down').on('click', function(){ if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){ var target=$(this.hash); target=target.length ? target:$('[name=' + this.hash.slice(1) +']'); if(target.length){ $('html, body').animate({ scrollTop: target.offset().top }, 1000); return false; }} }); })(jQuery); (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ProgressBar=f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=timeoutHandler_endTime; timeoutHandler_offset=duration - ( timeoutHandler_endTime - timeoutHandler_currentTime); if(tweenable.isPlaying()){ if(timeoutHandler_isEnded){ step(targetState, tweenable._attachment, timeoutHandler_offset); tweenable.stop(true); }else{ tweenable._scheduleId = schedule(tweenable._timeoutHandler, UPDATE_TIME); applyFilter(tweenable, 'beforeTween'); if(timeoutHandler_currentTime < (timestamp + delay)){ tweenProps(1, currentState, originalState, targetState, 1, 1, easing); }else{ tweenProps(timeoutHandler_currentTime, currentState, originalState, targetState, duration, timestamp + delay, easing); } applyFilter(tweenable, 'afterTween'); step(currentState, tweenable._attachment, timeoutHandler_offset); }} } function composeEasingObject (fromTweenParams, easing){ var composedEasing={}; var typeofEasing=typeof easing; if(typeofEasing==='string'||typeofEasing==='function'){ each(fromTweenParams, function (prop){ composedEasing[prop]=easing; }); }else{ each(fromTweenParams, function (prop){ if(!composedEasing[prop]){ composedEasing[prop]=easing[prop]||DEFAULT_EASING; }}); } return composedEasing; } function Tweenable (opt_initialState, opt_config){ this._currentState=opt_initialState||{}; this._configured=false; this._scheduleFunction=DEFAULT_SCHEDULE_FUNCTION; if(typeof opt_config!=='undefined'){ this.setConfig(opt_config); }} Tweenable.prototype.tween=function (opt_config){ if(this._isTweening){ return this; } if(opt_config!==undefined||!this._configured){ this.setConfig(opt_config); } this._timestamp=now(); this._start(this.get(), this._attachment); return this.resume(); }; /** * Configure a tween that will start at some point in the future. * * @method setConfig * @param {Object} config The following values are valid: * - __from__ (_Object=_): Starting position. If omitted, `{{#crossLink * "Tweenable/get:method"}}get(){{/crossLink}}` is used. * - __to__ (_Object=_): Ending position. * - __duration__ (_number=_): How many milliseconds to animate for. * - __delay__ (_delay=_): How many milliseconds to wait before starting the * tween. * - __start__ (_Function(Object, *)_): Function to execute when the tween * begins. Receives the state of the tween as the first parameter and * `attachment` as the second parameter. * - __step__ (_Function(Object, *, number)_): Function to execute on every * tick. Receives `{{#crossLink * "Tweenable/get:method"}}get(){{/crossLink}}` as the first parameter, * `attachment` as the second parameter, and the time elapsed since the * start of the tween as the third. This function is not called on the * final step of the animation, but `finish` is. * - __finish__ (_Function(Object, *)_): Function to execute upon tween * completion. Receives the state of the tween as the first parameter and * `attachment` as the second parameter. * - __easing__ (_Object.|string|Function=_): Easing curve * name(s) or function(s) to use for the tween. * - __attachment__ (_*_): Cached value that is passed to the * `step`/`start`/`finish` methods. * @chainable */ Tweenable.prototype.setConfig=function (config){ config=config||{}; this._configured=true; this._attachment=config.attachment; this._pausedAtTime=null; this._scheduleId=null; this._delay=config.delay||0; this._start=config.start||noop; this._step=config.step||noop; this._finish=config.finish||noop; this._duration=config.duration||DEFAULT_DURATION; this._currentState=shallowCopy({}, config.from)||this.get(); this._originalState=this.get(); this._targetState=shallowCopy({}, config.to)||this.get(); var self=this; this._timeoutHandler=function (){ timeoutHandler(self, self._timestamp, self._delay, self._duration, self._currentState, self._originalState, self._targetState, self._easing, self._step, self._scheduleFunction ); }; var currentState=this._currentState; var targetState=this._targetState; defaults(targetState, currentState); this._easing=composeEasingObject( currentState, config.easing||DEFAULT_EASING); this._filterArgs = [currentState, this._originalState, targetState, this._easing]; applyFilter(this, 'tweenCreated'); return this; }; Tweenable.prototype.get=function (){ return shallowCopy({}, this._currentState); }; Tweenable.prototype.set=function (state){ this._currentState=state; }; Tweenable.prototype.pause=function (){ this._pausedAtTime=now(); this._isPaused=true; return this; }; Tweenable.prototype.resume=function (){ if(this._isPaused){ this._timestamp +=now() - this._pausedAtTime; } this._isPaused=false; this._isTweening=true; this._timeoutHandler(); return this; }; Tweenable.prototype.seek=function (millisecond){ millisecond=Math.max(millisecond, 0); var currentTime=now(); if((this._timestamp + millisecond)===0){ return this; } this._timestamp=currentTime - millisecond; if(!this.isPlaying()){ this._isTweening=true; this._isPaused=false; timeoutHandler(this, this._timestamp, this._delay, this._duration, this._currentState, this._originalState, this._targetState, this._easing, this._step, this._scheduleFunction, currentTime ); this.pause(); } return this; }; Tweenable.prototype.stop=function (gotoEnd){ this._isTweening=false; this._isPaused=false; this._timeoutHandler=noop; (root.cancelAnimationFrame || root.webkitCancelAnimationFrame || root.oCancelAnimationFrame || root.msCancelAnimationFrame || root.mozCancelRequestAnimationFrame || root.clearTimeout)(this._scheduleId); if(gotoEnd){ applyFilter(this, 'beforeTween'); tweenProps( 1, this._currentState, this._originalState, this._targetState, 1, 0, this._easing ); applyFilter(this, 'afterTween'); applyFilter(this, 'afterTweenEnd'); this._finish.call(this, this._currentState, this._attachment); } return this; }; Tweenable.prototype.isPlaying=function (){ return this._isTweening&&!this._isPaused; }; Tweenable.prototype.setScheduleFunction=function (scheduleFunction){ this._scheduleFunction=scheduleFunction; }; Tweenable.prototype.dispose=function (){ var prop; for (prop in this){ if(this.hasOwnProperty(prop)){ delete this[prop]; }} }; Tweenable.prototype.filter={}; Tweenable.prototype.formula={ linear: function (pos){ return pos; }}; formula=Tweenable.prototype.formula; shallowCopy(Tweenable, { 'now': now ,'each': each ,'tweenProps': tweenProps ,'tweenProp': tweenProp ,'applyFilter': applyFilter ,'shallowCopy': shallowCopy ,'defaults': defaults ,'composeEasingObject': composeEasingObject }); if(typeof SHIFTY_DEBUG_NOW==='function'){ root.timeoutHandler=timeoutHandler; } if(typeof exports==='object'){ module.exports=Tweenable; }else if(typeof define==='function'&&define.amd){ define(function (){return Tweenable;}); }else if(typeof root.Tweenable==='undefined'){ root.Tweenable=Tweenable; } return Tweenable; } ()); ;(function (){ Tweenable.shallowCopy(Tweenable.prototype.formula, { easeInQuad: function (pos){ return Math.pow(pos, 2); }, easeOutQuad: function (pos){ return -(Math.pow((pos - 1), 2) - 1); }, easeInOutQuad: function (pos){ if((pos /=0.5) < 1){return 0.5 * Math.pow(pos,2);} return -0.5 * ((pos -=2) * pos - 2); }, easeInCubic: function (pos){ return Math.pow(pos, 3); }, easeOutCubic: function (pos){ return (Math.pow((pos - 1), 3) + 1); }, easeInOutCubic: function (pos){ if((pos /=0.5) < 1){return 0.5 * Math.pow(pos,3);} return 0.5 * (Math.pow((pos - 2),3) + 2); }, easeInQuart: function (pos){ return Math.pow(pos, 4); }, easeOutQuart: function (pos){ return -(Math.pow((pos - 1), 4) - 1); }, easeInOutQuart: function (pos){ if((pos /=0.5) < 1){return 0.5 * Math.pow(pos,4);} return -0.5 * ((pos -=2) * Math.pow(pos,3) - 2); }, easeInQuint: function (pos){ return Math.pow(pos, 5); }, easeOutQuint: function (pos){ return (Math.pow((pos - 1), 5) + 1); }, easeInOutQuint: function (pos){ if((pos /=0.5) < 1){return 0.5 * Math.pow(pos,5);} return 0.5 * (Math.pow((pos - 2),5) + 2); }, easeInSine: function (pos){ return -Math.cos(pos * (Math.PI / 2)) + 1; }, easeOutSine: function (pos){ return Math.sin(pos * (Math.PI / 2)); }, easeInOutSine: function (pos){ return (-0.5 * (Math.cos(Math.PI * pos) - 1)); }, easeInExpo: function (pos){ return (pos===0) ? 0:Math.pow(2, 10 * (pos - 1)); }, easeOutExpo: function (pos){ return (pos===1) ? 1:-Math.pow(2, -10 * pos) + 1; }, easeInOutExpo: function (pos){ if(pos===0){return 0;} if(pos===1){return 1;} if((pos /=0.5) < 1){return 0.5 * Math.pow(2,10 * (pos - 1));} return 0.5 * (-Math.pow(2, -10 * --pos) + 2); }, easeInCirc: function (pos){ return -(Math.sqrt(1 - (pos * pos)) - 1); }, easeOutCirc: function (pos){ return Math.sqrt(1 - Math.pow((pos - 1), 2)); }, easeInOutCirc: function (pos){ if((pos /=0.5) < 1){return -0.5 * (Math.sqrt(1 - pos * pos) - 1);} return 0.5 * (Math.sqrt(1 - (pos -=2) * pos) + 1); }, easeOutBounce: function (pos){ if((pos) < (1 / 2.75)){ return (7.5625 * pos * pos); }else if(pos < (2 / 2.75)){ return (7.5625 * (pos -=(1.5 / 2.75)) * pos + 0.75); }else if(pos < (2.5 / 2.75)){ return (7.5625 * (pos -=(2.25 / 2.75)) * pos + 0.9375); }else{ return (7.5625 * (pos -=(2.625 / 2.75)) * pos + 0.984375); }}, easeInBack: function (pos){ var s=1.70158; return (pos) * pos * ((s + 1) * pos - s); }, easeOutBack: function (pos){ var s=1.70158; return (pos=pos - 1) * pos * ((s + 1) * pos + s) + 1; }, easeInOutBack: function (pos){ var s=1.70158; if((pos /=0.5) < 1){ return 0.5 * (pos * pos * (((s *=(1.525)) + 1) * pos - s)); } return 0.5 * ((pos -=2) * pos * (((s *=(1.525)) + 1) * pos + s) + 2); }, elastic: function (pos){ return -1 * Math.pow(4,-8 * pos) * Math.sin((pos * 6 - 1) * (2 * Math.PI) / 2) + 1; }, swingFromTo: function (pos){ var s=1.70158; return ((pos /=0.5) < 1) ? 0.5 * (pos * pos * (((s *=(1.525)) + 1) * pos - s)) : 0.5 * ((pos -=2) * pos * (((s *=(1.525)) + 1) * pos + s) + 2); }, swingFrom: function (pos){ var s=1.70158; return pos * pos * ((s + 1) * pos - s); }, swingTo: function (pos){ var s=1.70158; return (pos -=1) * pos * ((s + 1) * pos + s) + 1; }, bounce: function (pos){ if(pos < (1 / 2.75)){ return (7.5625 * pos * pos); }else if(pos < (2 / 2.75)){ return (7.5625 * (pos -=(1.5 / 2.75)) * pos + 0.75); }else if(pos < (2.5 / 2.75)){ return (7.5625 * (pos -=(2.25 / 2.75)) * pos + 0.9375); }else{ return (7.5625 * (pos -=(2.625 / 2.75)) * pos + 0.984375); }}, bouncePast: function (pos){ if(pos < (1 / 2.75)){ return (7.5625 * pos * pos); }else if(pos < (2 / 2.75)){ return 2 - (7.5625 * (pos -=(1.5 / 2.75)) * pos + 0.75); }else if(pos < (2.5 / 2.75)){ return 2 - (7.5625 * (pos -=(2.25 / 2.75)) * pos + 0.9375); }else{ return 2 - (7.5625 * (pos -=(2.625 / 2.75)) * pos + 0.984375); }}, easeFromTo: function (pos){ if((pos /=0.5) < 1){return 0.5 * Math.pow(pos,4);} return -0.5 * ((pos -=2) * Math.pow(pos,3) - 2); }, easeFrom: function (pos){ return Math.pow(pos,4); }, easeTo: function (pos){ return Math.pow(pos,0.25); }}); }()); ;(function (){ function cubicBezierAtTime(t,p1x,p1y,p2x,p2y,duration){ var ax=0,bx=0,cx=0,ay=0,by=0,cy=0; function sampleCurveX(t){ return ((ax * t + bx) * t + cx) * t; } function sampleCurveY(t){ return ((ay * t + by) * t + cy) * t; } function sampleCurveDerivativeX(t){ return (3.0 * ax * t + 2.0 * bx) * t + cx; } function solveEpsilon(duration){ return 1.0 / (200.0 * duration); } function solve(x,epsilon){ return sampleCurveY(solveCurveX(x, epsilon)); } function fabs(n){ if(n >=0){ return n; }else{ return 0 - n; }} function solveCurveX(x, epsilon){ var t0,t1,t2,x2,d2,i; for (t2=x, i=0; i < 8; i++){ x2=sampleCurveX(t2) - x; if(fabs(x2) < epsilon){ return t2; } d2=sampleCurveDerivativeX(t2); if(fabs(d2) < 1e-6){ break; } t2=t2 - x2 / d2; } t0=0.0; t1=1.0; t2=x; if(t2 < t0){ return t0; } if(t2 > t1){ return t1; } while (t0 < t1){ x2=sampleCurveX(t2); if(fabs(x2 - x) < epsilon){ return t2; } if(x > x2){ t0=t2; }else{ t1=t2; } t2=(t1 - t0) * 0.5 + t0; } return t2; } cx=3.0 * p1x; bx=3.0 * (p2x - p1x) - cx; ax=1.0 - cx - bx; cy=3.0 * p1y; by=3.0 * (p2y - p1y) - cy; ay=1.0 - cy - by; return solve(t, solveEpsilon(duration)); } function getCubicBezierTransition (x1, y1, x2, y2){ return function (pos){ return cubicBezierAtTime(pos,x1,y1,x2,y2,1); };} Tweenable.setBezierFunction=function (name, x1, y1, x2, y2){ var cubicBezierTransition=getCubicBezierTransition(x1, y1, x2, y2); cubicBezierTransition.displayName=name; cubicBezierTransition.x1=x1; cubicBezierTransition.y1=y1; cubicBezierTransition.x2=x2; cubicBezierTransition.y2=y2; return Tweenable.prototype.formula[name]=cubicBezierTransition; }; Tweenable.unsetBezierFunction=function (name){ delete Tweenable.prototype.formula[name]; };})(); ;(function (){ function getInterpolatedValues ( from, current, targetState, position, easing, delay){ return Tweenable.tweenProps(position, current, from, targetState, 1, delay, easing); } var mockTweenable=new Tweenable(); mockTweenable._filterArgs=[]; /** * Compute the midpoint of two Objects. This method effectively calculates a * specific frame of animation that `{{#crossLink * "Tweenable/tween:method"}}{{/crossLink}}` does many times over the course * of a full tween. * * var interpolatedValues=Tweenable.interpolate({ * width: '100px', * opacity: 0, * color: '#fff' * }, { * width: '200px', * opacity: 1, * color: '#000' * }, 0.5); * * console.log(interpolatedValues); * * * @static * @method interpolate * @param {Object} from The starting values to tween from. * @param {Object} targetState The ending values to tween to. * @param {number} position The normalized position value (between `0.0` and * `1.0`) to interpolate the values between `from` and `to` for. `from` * represents `0` and `to` represents `1`. * @param {Object.|string|Function} easing The easing * curve(s) to calculate the midpoint against. You can reference any easing * function attached to `Tweenable.prototype.formula`, or provide the easing * function(s) directly. If omitted, this defaults to "linear". * @param {number=} opt_delay Optional delay to pad the beginning of the * interpolated tween with. This increases the range of `position` from (`0` * through `1`) to (`0` through `1 + opt_delay`). So, a delay of `0.5` would * increase all valid values of `position` to numbers between `0` and `1.5`. * @return {Object} */ Tweenable.interpolate=function ( from, targetState, position, easing, opt_delay){ var current=Tweenable.shallowCopy({}, from); var delay=opt_delay||0; var easingObject=Tweenable.composeEasingObject(from, easing||'linear'); mockTweenable.set({}); var filterArgs=mockTweenable._filterArgs; filterArgs.length=0; filterArgs[0]=current; filterArgs[1]=from; filterArgs[2]=targetState; filterArgs[3]=easingObject; Tweenable.applyFilter(mockTweenable, 'tweenCreated'); Tweenable.applyFilter(mockTweenable, 'beforeTween'); var interpolatedValues=getInterpolatedValues( from, current, targetState, position, easingObject, delay); Tweenable.applyFilter(mockTweenable, 'afterTween'); return interpolatedValues; };}()); ;(function (Tweenable){ var formatManifest; var R_NUMBER_COMPONENT=/(\d|\-|\.)/; var R_FORMAT_CHUNKS=/([^\-0-9\.]+)/g; var R_UNFORMATTED_VALUES=/[0-9.\-]+/g; var R_RGB=new RegExp( 'rgb\\(' + R_UNFORMATTED_VALUES.source + (/,\s*/.source) + R_UNFORMATTED_VALUES.source + (/,\s*/.source) + R_UNFORMATTED_VALUES.source + '\\)', 'g'); var R_RGB_PREFIX=/^.*\(/; var R_HEX=/#([0-9]|[a-f]){3,6}/gi; var VALUE_PLACEHOLDER='VAL'; function getFormatChunksFrom (rawValues, prefix){ var accumulator=[]; var rawValuesLength=rawValues.length; var i; for (i=0; i < rawValuesLength; i++){ accumulator.push('_' + prefix + '_' + i); } return accumulator; } function getFormatStringFrom (formattedString){ var chunks=formattedString.match(R_FORMAT_CHUNKS); if(!chunks){ chunks=['', '']; }else if(chunks.length===1 || formattedString[0].match(R_NUMBER_COMPONENT)){ chunks.unshift(''); } return chunks.join(VALUE_PLACEHOLDER); } function sanitizeObjectForHexProps (stateObject){ Tweenable.each(stateObject, function (prop){ var currentProp=stateObject[prop]; if(typeof currentProp==='string'&¤tProp.match(R_HEX)){ stateObject[prop]=sanitizeHexChunksToRGB(currentProp); }}); } function sanitizeHexChunksToRGB (str){ return filterStringChunks(R_HEX, str, convertHexToRGB); } function convertHexToRGB (hexString){ var rgbArr=hexToRGBArray(hexString); return 'rgb(' + rgbArr[0] + ',' + rgbArr[1] + ',' + rgbArr[2] + ')'; } var hexToRGBArray_returnArray=[]; function hexToRGBArray (hex){ hex=hex.replace(/#/, ''); if(hex.length===3){ hex=hex.split(''); hex=hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } hexToRGBArray_returnArray[0]=hexToDec(hex.substr(0, 2)); hexToRGBArray_returnArray[1]=hexToDec(hex.substr(2, 2)); hexToRGBArray_returnArray[2]=hexToDec(hex.substr(4, 2)); return hexToRGBArray_returnArray; } function hexToDec (hex){ return parseInt(hex, 16); } /** * Runs a filter operation on all chunks of a string that match a RegExp * * @param {RegExp} pattern * @param {string} unfilteredString * @param {function(string)} filter * * @return {string} * @private */ function filterStringChunks (pattern, unfilteredString, filter){ var pattenMatches=unfilteredString.match(pattern); var filteredString=unfilteredString.replace(pattern, VALUE_PLACEHOLDER); if(pattenMatches){ var pattenMatchesLength=pattenMatches.length; var currentChunk; for (var i=0; i < pattenMatchesLength; i++){ currentChunk=pattenMatches.shift(); filteredString=filteredString.replace(VALUE_PLACEHOLDER, filter(currentChunk)); }} return filteredString; } function sanitizeRGBChunks (formattedString){ return filterStringChunks(R_RGB, formattedString, sanitizeRGBChunk); } function sanitizeRGBChunk (rgbChunk){ var numbers=rgbChunk.match(R_UNFORMATTED_VALUES); var numbersLength=numbers.length; var sanitizedString=rgbChunk.match(R_RGB_PREFIX)[0]; for (var i=0; i < numbersLength; i++){ sanitizedString +=parseInt(numbers[i], 10) + ','; } sanitizedString=sanitizedString.slice(0, -1) + ')'; return sanitizedString; } function getFormatManifests (stateObject){ var manifestAccumulator={}; Tweenable.each(stateObject, function (prop){ var currentProp=stateObject[prop]; if(typeof currentProp==='string'){ var rawValues=getValuesFrom(currentProp); manifestAccumulator[prop]={ 'formatString': getFormatStringFrom(currentProp) ,'chunkNames': getFormatChunksFrom(rawValues, prop) };}}); return manifestAccumulator; } function expandFormattedProperties (stateObject, formatManifests){ Tweenable.each(formatManifests, function (prop){ var currentProp=stateObject[prop]; var rawValues=getValuesFrom(currentProp); var rawValuesLength=rawValues.length; for (var i=0; i < rawValuesLength; i++){ stateObject[formatManifests[prop].chunkNames[i]]=+rawValues[i]; } delete stateObject[prop]; }); } function collapseFormattedProperties (stateObject, formatManifests){ Tweenable.each(formatManifests, function (prop){ var currentProp=stateObject[prop]; var formatChunks=extractPropertyChunks( stateObject, formatManifests[prop].chunkNames); var valuesList=getValuesList( formatChunks, formatManifests[prop].chunkNames); currentProp=getFormattedValues( formatManifests[prop].formatString, valuesList); stateObject[prop]=sanitizeRGBChunks(currentProp); }); } function extractPropertyChunks (stateObject, chunkNames){ var extractedValues={}; var currentChunkName, chunkNamesLength=chunkNames.length; for (var i=0; i < chunkNamesLength; i++){ currentChunkName=chunkNames[i]; extractedValues[currentChunkName]=stateObject[currentChunkName]; delete stateObject[currentChunkName]; } return extractedValues; } var getValuesList_accumulator=[]; function getValuesList (stateObject, chunkNames){ getValuesList_accumulator.length=0; var chunkNamesLength=chunkNames.length; for (var i=0; i < chunkNamesLength; i++){ getValuesList_accumulator.push(stateObject[chunkNames[i]]); } return getValuesList_accumulator; } function getFormattedValues (formatString, rawValues){ var formattedValueString=formatString; var rawValuesLength=rawValues.length; for (var i=0; i < rawValuesLength; i++){ formattedValueString=formattedValueString.replace(VALUE_PLACEHOLDER, +rawValues[i].toFixed(4)); } return formattedValueString; } function getValuesFrom (formattedString){ return formattedString.match(R_UNFORMATTED_VALUES); } function expandEasingObject (easingObject, tokenData){ Tweenable.each(tokenData, function (prop){ var currentProp=tokenData[prop]; var chunkNames=currentProp.chunkNames; var chunkLength=chunkNames.length; var easing=easingObject[prop]; var i; if(typeof easing==='string'){ var easingChunks=easing.split(' '); var lastEasingChunk=easingChunks[easingChunks.length - 1]; for (i=0; i < chunkLength; i++){ easingObject[chunkNames[i]]=easingChunks[i]||lastEasingChunk; }}else{ for (i=0; i < chunkLength; i++){ easingObject[chunkNames[i]]=easing; }} delete easingObject[prop]; }); } function collapseEasingObject (easingObject, tokenData){ Tweenable.each(tokenData, function (prop){ var currentProp=tokenData[prop]; var chunkNames=currentProp.chunkNames; var chunkLength=chunkNames.length; var firstEasing=easingObject[chunkNames[0]]; var typeofEasings=typeof firstEasing; if(typeofEasings==='string'){ var composedEasingString=''; for (var i=0; i < chunkLength; i++){ composedEasingString +=' ' + easingObject[chunkNames[i]]; delete easingObject[chunkNames[i]]; } easingObject[prop]=composedEasingString.substr(1); }else{ easingObject[prop]=firstEasing; }}); } Tweenable.prototype.filter.token={ 'tweenCreated': function (currentState, fromState, toState, easingObject){ sanitizeObjectForHexProps(currentState); sanitizeObjectForHexProps(fromState); sanitizeObjectForHexProps(toState); this._tokenData=getFormatManifests(currentState); }, 'beforeTween': function (currentState, fromState, toState, easingObject){ expandEasingObject(easingObject, this._tokenData); expandFormattedProperties(currentState, this._tokenData); expandFormattedProperties(fromState, this._tokenData); expandFormattedProperties(toState, this._tokenData); }, 'afterTween': function (currentState, fromState, toState, easingObject){ collapseFormattedProperties(currentState, this._tokenData); collapseFormattedProperties(fromState, this._tokenData); collapseFormattedProperties(toState, this._tokenData); collapseEasingObject(easingObject, this._tokenData); }};} (Tweenable)); }).call(null); },{}],2:[function(require,module,exports){ var Shape=require('./shape'); var utils=require('./utils'); var Circle=function Circle(container, options){ this._pathTemplate = 'M 50,50 m 0,-{radius}' + ' a {radius},{radius} 0 1 1 0,{2radius}' + ' a {radius},{radius} 0 1 1 0,-{2radius}'; this.containerAspectRatio=1; Shape.apply(this, arguments); }; Circle.prototype=new Shape(); Circle.prototype.constructor=Circle; Circle.prototype._pathString=function _pathString(opts){ var widthOfWider=opts.strokeWidth; if(opts.trailWidth&&opts.trailWidth > opts.strokeWidth){ widthOfWider=opts.trailWidth; } var r=50 - widthOfWider / 2; return utils.render(this._pathTemplate, { radius: r, '2radius': r * 2 }); }; Circle.prototype._trailString=function _trailString(opts){ return this._pathString(opts); }; module.exports=Circle; },{"./shape":7,"./utils":8}],3:[function(require,module,exports){ var Shape=require('./shape'); var utils=require('./utils'); var Line=function Line(container, options){ this._pathTemplate='M 0,{center} L 100,{center}'; Shape.apply(this, arguments); }; Line.prototype=new Shape(); Line.prototype.constructor=Line; Line.prototype._initializeSvg=function _initializeSvg(svg, opts){ svg.setAttribute('viewBox', '0 0 100 ' + opts.strokeWidth); svg.setAttribute('preserveAspectRatio', 'none'); }; Line.prototype._pathString=function _pathString(opts){ return utils.render(this._pathTemplate, { center: opts.strokeWidth / 2 }); }; Line.prototype._trailString=function _trailString(opts){ return this._pathString(opts); }; module.exports=Line; },{"./shape":7,"./utils":8}],4:[function(require,module,exports){ module.exports={ Line: require('./line'), Circle: require('./circle'), SemiCircle: require('./semicircle'), Path: require('./path'), Shape: require('./shape'), utils: require('./utils') };},{"./circle":2,"./line":3,"./path":5,"./semicircle":6,"./shape":7,"./utils":8}],5:[function(require,module,exports){ var Tweenable=require('shifty'); var utils=require('./utils'); var EASING_ALIASES={ easeIn: 'easeInCubic', easeOut: 'easeOutCubic', easeInOut: 'easeInOutCubic' }; var Path=function Path(path, opts){ if(!(this instanceof Path)){ throw new Error('Constructor was called without new keyword'); } opts=utils.extend({ duration: 800, easing: 'linear', from: {}, to: {}, step: function(){}}, opts); var element; if(utils.isString(path)){ element=document.querySelector(path); }else{ element=path; } this.path=element; this._opts=opts; this._tweenable=null; var length=this.path.getTotalLength(); this.path.style.strokeDasharray=length + ' ' + length; this.set(0); }; Path.prototype.value=function value(){ var offset=this._getComputedDashOffset(); var length=this.path.getTotalLength(); var progress=1 - offset / length; return parseFloat(progress.toFixed(6), 10); }; Path.prototype.set=function set(progress){ this.stop(); this.path.style.strokeDashoffset=this._progressToOffset(progress); var step=this._opts.step; if(utils.isFunction(step)){ var easing=this._easing(this._opts.easing); var values=this._calculateTo(progress, easing); var reference=this._opts.shape||this; step(values, reference, this._opts.attachment); }}; Path.prototype.stop=function stop(){ this._stopTween(); this.path.style.strokeDashoffset=this._getComputedDashOffset(); }; Path.prototype.animate=function animate(progress, opts, cb){ opts=opts||{}; if(utils.isFunction(opts)){ cb=opts; opts={};} var passedOpts=utils.extend({}, opts); var defaultOpts=utils.extend({}, this._opts); opts=utils.extend(defaultOpts, opts); var shiftyEasing=this._easing(opts.easing); var values=this._resolveFromAndTo(progress, shiftyEasing, passedOpts); this.stop(); this.path.getBoundingClientRect(); var offset=this._getComputedDashOffset(); var newOffset=this._progressToOffset(progress); var self=this; this._tweenable=new Tweenable(); this._tweenable.tween({ from: utils.extend({ offset: offset }, values.from), to: utils.extend({ offset: newOffset }, values.to), duration: opts.duration, easing: shiftyEasing, step: function(state){ self.path.style.strokeDashoffset=state.offset; var reference=opts.shape||self; opts.step(state, reference, opts.attachment); }, finish: function(state){ if(utils.isFunction(cb)){ cb(); }} }); }; Path.prototype._getComputedDashOffset=function _getComputedDashOffset(){ var computedStyle=window.getComputedStyle(this.path, null); return parseFloat(computedStyle.getPropertyValue('stroke-dashoffset'), 10); }; Path.prototype._progressToOffset=function _progressToOffset(progress){ var length=this.path.getTotalLength(); return length - progress * length; }; Path.prototype._resolveFromAndTo=function _resolveFromAndTo(progress, easing, opts){ if(opts.from&&opts.to){ return { from: opts.from, to: opts.to };} return { from: this._calculateFrom(easing), to: this._calculateTo(progress, easing) };}; Path.prototype._calculateFrom=function _calculateFrom(easing){ return Tweenable.interpolate(this._opts.from, this._opts.to, this.value(), easing); }; Path.prototype._calculateTo=function _calculateTo(progress, easing){ return Tweenable.interpolate(this._opts.from, this._opts.to, progress, easing); }; Path.prototype._stopTween=function _stopTween(){ if(this._tweenable!==null){ this._tweenable.stop(); this._tweenable=null; }}; Path.prototype._easing=function _easing(easing){ if(EASING_ALIASES.hasOwnProperty(easing)){ return EASING_ALIASES[easing]; } return easing; }; module.exports=Path; },{"./utils":8,"shifty":1}],6:[function(require,module,exports){ var Shape=require('./shape'); var Circle=require('./circle'); var utils=require('./utils'); var SemiCircle=function SemiCircle(container, options){ this._pathTemplate = 'M 50,50 m -{radius},0' + ' a {radius},{radius} 0 1 1 {2radius},0'; this.containerAspectRatio=2; Shape.apply(this, arguments); }; SemiCircle.prototype=new Shape(); SemiCircle.prototype.constructor=SemiCircle; SemiCircle.prototype._initializeSvg=function _initializeSvg(svg, opts){ svg.setAttribute('viewBox', '0 0 100 50'); }; SemiCircle.prototype._initializeTextContainer=function _initializeTextContainer( opts, container, textContainer ){ if(opts.text.style){ textContainer.style.top='auto'; textContainer.style.bottom='0'; if(opts.text.alignToBottom){ utils.setStyle(textContainer, 'transform', 'translate(-50%, 0)'); }else{ utils.setStyle(textContainer, 'transform', 'translate(-50%, 50%)'); }} }; SemiCircle.prototype._pathString=Circle.prototype._pathString; SemiCircle.prototype._trailString=Circle.prototype._trailString; module.exports=SemiCircle; },{"./circle":2,"./shape":7,"./utils":8}],7:[function(require,module,exports){ var Path=require('./path'); var utils=require('./utils'); var DESTROYED_ERROR='Object is destroyed'; var Shape=function Shape(container, opts){ if(!(this instanceof Shape)){ throw new Error('Constructor was called without new keyword'); } if(arguments.length===0){ return; } this._opts=utils.extend({ color: '#555', strokeWidth: 1.0, trailColor: null, trailWidth: null, fill: null, text: { style: { color: null, position: 'absolute', left: '50%', top: '50%', padding: 0, margin: 0, transform: { prefix: true, value: 'translate(-50%, -50%)' }}, autoStyleContainer: true, alignToBottom: true, value: null, className: 'progressbar-text' }, svgStyle: { display: 'block', width: '100%' }, warnings: false }, opts, true); if(utils.isObject(opts)&&opts.svgStyle!==undefined){ this._opts.svgStyle=opts.svgStyle; } if(utils.isObject(opts)&&utils.isObject(opts.text)&&opts.text.style!==undefined){ this._opts.text.style=opts.text.style; } var svgView=this._createSvgView(this._opts); var element; if(utils.isString(container)){ element=document.querySelector(container); }else{ element=container; } if(!element){ throw new Error('Container does not exist: ' + container); } this._container=element; this._container.appendChild(svgView.svg); if(this._opts.warnings){ this._warnContainerAspectRatio(this._container); } if(this._opts.svgStyle){ utils.setStyles(svgView.svg, this._opts.svgStyle); } this.svg=svgView.svg; this.path=svgView.path; this.trail=svgView.trail; this.text=null; var newOpts=utils.extend({ attachment: undefined, shape: this }, this._opts); this._progressPath=new Path(svgView.path, newOpts); if(utils.isObject(this._opts.text)&&this._opts.text.value!==null){ this.setText(this._opts.text.value); }}; Shape.prototype.animate=function animate(progress, opts, cb){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } this._progressPath.animate(progress, opts, cb); }; Shape.prototype.stop=function stop(){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } if(this._progressPath===undefined){ return; } this._progressPath.stop(); }; Shape.prototype.destroy=function destroy(){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } this.stop(); this.svg.parentNode.removeChild(this.svg); this.svg=null; this.path=null; this.trail=null; this._progressPath=null; if(this.text!==null){ this.text.parentNode.removeChild(this.text); this.text=null; }}; Shape.prototype.set=function set(progress){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } this._progressPath.set(progress); }; Shape.prototype.value=function value(){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } if(this._progressPath===undefined){ return 0; } return this._progressPath.value(); }; Shape.prototype.setText=function setText(newText){ if(this._progressPath===null){ throw new Error(DESTROYED_ERROR); } if(this.text===null){ this.text=this._createTextContainer(this._opts, this._container); this._container.appendChild(this.text); } if(utils.isObject(newText)){ utils.removeChildren(this.text); this.text.appendChild(newText); }else{ this.text.innerHTML=newText; }}; Shape.prototype._createSvgView=function _createSvgView(opts){ var svg=document.createElementNS('http://www.w3.org/2000/svg', 'svg'); this._initializeSvg(svg, opts); var trailPath=null; if(opts.trailColor||opts.trailWidth){ trailPath=this._createTrail(opts); svg.appendChild(trailPath); } var path=this._createPath(opts); svg.appendChild(path); return { svg: svg, path: path, trail: trailPath };}; Shape.prototype._initializeSvg=function _initializeSvg(svg, opts){ svg.setAttribute('viewBox', '0 0 100 100'); }; Shape.prototype._createPath=function _createPath(opts){ var pathString=this._pathString(opts); return this._createPathElement(pathString, opts); }; Shape.prototype._createTrail=function _createTrail(opts){ var pathString=this._trailString(opts); var newOpts=utils.extend({}, opts); if(!newOpts.trailColor){ newOpts.trailColor='#eee'; } if(!newOpts.trailWidth){ newOpts.trailWidth=newOpts.strokeWidth; } newOpts.color=newOpts.trailColor; newOpts.strokeWidth=newOpts.trailWidth; newOpts.fill=null; return this._createPathElement(pathString, newOpts); }; Shape.prototype._createPathElement=function _createPathElement(pathString, opts){ var path=document.createElementNS('http://www.w3.org/2000/svg', 'path'); path.setAttribute('d', pathString); path.setAttribute('stroke', opts.color); path.setAttribute('stroke-width', opts.strokeWidth); if(opts.fill){ path.setAttribute('fill', opts.fill); }else{ path.setAttribute('fill-opacity', '0'); } return path; }; Shape.prototype._createTextContainer=function _createTextContainer(opts, container){ var textContainer=document.createElement('div'); textContainer.className=opts.text.className; var textStyle=opts.text.style; if(textStyle){ if(opts.text.autoStyleContainer){ container.style.position='relative'; } utils.setStyles(textContainer, textStyle); if(!textStyle.color){ textContainer.style.color=opts.color; }} this._initializeTextContainer(opts, container, textContainer); return textContainer; }; Shape.prototype._initializeTextContainer=function(opts, container, element){ }; Shape.prototype._pathString=function _pathString(opts){ throw new Error('Override this function for each progress bar'); }; Shape.prototype._trailString=function _trailString(opts){ throw new Error('Override this function for each progress bar'); }; Shape.prototype._warnContainerAspectRatio=function _warnContainerAspectRatio(container){ if(!this.containerAspectRatio){ return; } var computedStyle=window.getComputedStyle(container, null); var width=parseFloat(computedStyle.getPropertyValue('width'), 10); var height=parseFloat(computedStyle.getPropertyValue('height'), 10); if(!utils.floatEquals(this.containerAspectRatio, width / height)){ console.warn('Incorrect aspect ratio of container', '#' + container.id, 'detected:', computedStyle.getPropertyValue('width') + '(width)', '/', computedStyle.getPropertyValue('height') + '(height)', '=', width / height ); console.warn('Aspect ratio of should be', this.containerAspectRatio ); }}; module.exports=Shape; },{"./path":5,"./utils":8}],8:[function(require,module,exports){ var PREFIXES='Webkit Moz O ms'.split(' '); var FLOAT_COMPARISON_EPSILON=0.001; function extend(destination, source, recursive){ destination=destination||{}; source=source||{}; recursive=recursive||false; for (var attrName in source){ if(source.hasOwnProperty(attrName)){ var destVal=destination[attrName]; var sourceVal=source[attrName]; if(recursive&&isObject(destVal)&&isObject(sourceVal)){ destination[attrName]=extend(destVal, sourceVal, recursive); }else{ destination[attrName]=sourceVal; }} } return destination; } function render(template, vars){ var rendered=template; for (var key in vars){ if(vars.hasOwnProperty(key)){ var val=vars[key]; var regExpString='\\{' + key + '\\}'; var regExp=new RegExp(regExpString, 'g'); rendered=rendered.replace(regExp, val); }} return rendered; } function setStyle(element, style, value){ var elStyle=element.style; for (var i=0; i < PREFIXES.length; ++i){ var prefix=PREFIXES[i]; elStyle[prefix + capitalize(style)]=value; } elStyle[style]=value; } function setStyles(element, styles){ forEachObject(styles, function(styleValue, styleName){ if(styleValue===null||styleValue===undefined){ return; } if(isObject(styleValue)&&styleValue.prefix===true){ setStyle(element, styleName, styleValue.value); }else{ element.style[styleName]=styleValue; }}); } function capitalize(text){ return text.charAt(0).toUpperCase() + text.slice(1); } function isString(obj){ return typeof obj==='string'||obj instanceof String; } function isFunction(obj){ return typeof obj==='function'; } function isArray(obj){ return Object.prototype.toString.call(obj)==='[object Array]'; } function isObject(obj){ if(isArray(obj)){ return false; } var type=typeof obj; return type==='object'&&!!obj; } function forEachObject(object, callback){ for (var key in object){ if(object.hasOwnProperty(key)){ var val=object[key]; callback(val, key); }} } function floatEquals(a, b){ return Math.abs(a - b) < FLOAT_COMPARISON_EPSILON; } function removeChildren(el){ while (el.firstChild){ el.removeChild(el.firstChild); }} module.exports={ extend: extend, render: render, setStyle: setStyle, setStyles: setStyles, capitalize: capitalize, isString: isString, isFunction: isFunction, isObject: isObject, forEachObject: forEachObject, floatEquals: floatEquals, removeChildren: removeChildren };},{}]},{},[4])(4) }); (function($){ var bt_bb_advanced_progressbar_init_finished=false; document.addEventListener('readystatechange', function(){ if(! bt_bb_advanced_progressbar_init_finished&&(document.readyState==='interactive'||document.readyState==='complete')){ $(document).scroll(function(){ bt_bb_animate_elements_adv_progressbar(); }); $(document).ready(function (){ bt_bb_animate_elements_adv_progressbar(); }); bt_bb_advanced_progressbar_init_finished=true; }}, false); function bt_bb_animate_elements_adv_progressbar(){ var $elems=$('.bt_bb_progress_bar_advanced.animate-adv_progressbar:not(.animated-adv_progressbar)'); $elems.each(function(){ var $elm=$(this); if($elm.isOnScreen_adv_progressbar()){ $elm.addClass('animated-adv_progressbar'); bt_bb_animate_progress_advanced($elm); }}); } $.fn.isOnScreen_adv_progressbar=function(){ var element=this.get(0); var bounds=element.getBoundingClientRect(); return bounds.top + 75 < window.innerHeight&&bounds.bottom > 0; } function bt_bb_animate_progress_advanced(elm){ var container=elm.data('container'); var pbid=elm.data('container-pbid'); var container_type=elm.data('container-type'); var container_percentage=elm.data('container-percentage'); var container_text_color=elm.data('container-text-color'); var container_stroke_width=elm.data('container-stroke-width'); var container_trail_color=elm.data('container-trail-color'); var container_trail_width=elm.data('container-trail-width'); var container_easing=elm.data('container-easing'); var container_color_from=elm.data('container-color-from'); var container_depth_from=elm.data('container-depth-from'); var container_color_to=elm.data('container-color-to'); var container_depth_to=elm.data('container-depth-to'); var container_fill=elm.data('container-fill'); var container_text=elm.data('container-text'); var container_duration=elm.data('container-duration'); var container_icon=elm.data('container-icon'); if(container_type=='circle'){ bt_bb_progressbar_circle_init( container, container_percentage, container_text_color, container_stroke_width, container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid); }else{ bt_bb_progressbar_semicircle_init( container, container_percentage, container_text_color, container_stroke_width, container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid); } return false; }})(jQuery); function bt_bb_progressbar_circle_init(container, container_percentage, container_text_color, container_stroke_width, container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid){ if(pbid > 0){ container="#container_" + pbid; } var display_icon=""; if(container_icon){ var icon_set=container_icon.substring(0, container_icon.lastIndexOf("_")); var icon_icon=container_icon.substr(container_icon.lastIndexOf("_")+1); display_icon=""; } var circle=new ProgressBar.Circle(container, { color: container_text_color, strokeWidth: container_stroke_width, trailColor: container_trail_color, trailWidth: container_trail_width, easing: container_easing, duration: container_duration, text: { value: '', autoStyleContainer: false, style: { color: container_text_color, transform: { prefix: true, }}, autoStyleContainer: false }, from: { color: container_color_from, width: container_depth_from }, to: { color: container_color_to, width: container_depth_to }, fill: container_fill, step: function(state, circle){ circle.path.setAttribute('stroke', state.color); circle.path.setAttribute('stroke-width', state.width); var value=Math.round(circle.value() * 100); if(!container_icon){ circle.setText(value + '%'); }} }); if(container_icon&&display_icon){ circle.setText(display_icon); } circle.animate(container_percentage); } function bt_bb_progressbar_semicircle_init(container,container_percentage, container_text_color, container_stroke_width, container_trail_color, container_trail_width, container_easing, container_color_from, container_depth_from, container_color_to, container_depth_to, container_fill, container_text, container_duration, container_icon, pbid){ if(pbid > 0){ container="#container_" + pbid; } var display_icon=""; if(container_icon){ var icon_set=container_icon.substring(0, container_icon.lastIndexOf("_")); var icon_icon=container_icon.substr(container_icon.lastIndexOf("_")+1); display_icon=""; } var semicircle=new ProgressBar.SemiCircle(container, { strokeWidth: container_stroke_width, easing: container_easing, duration: container_duration, color: container_text_color, trailColor: container_trail_color, trailWidth: container_trail_width, svgStyle: null, text: { value: '', autoStyleContainer: false, style: { color: container_text_color, transform: { prefix: true, }}, alignToBottom: false }, fill: container_fill, from: { color: container_color_from, width: container_depth_from }, to: { color: container_color_to, width: container_depth_to }, step: function(state, semicircle){ semicircle.path.setAttribute('stroke', state.color); semicircle.path.setAttribute('stroke-width', state.width); var value=Math.round(semicircle.value() * 100); if(!container_icon){ semicircle.setText(value + '%'); }} }); if(container_icon&&display_icon){ semicircle.setText(display_icon); } semicircle.animate(container_percentage); }; !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;oe;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;is?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}); !function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window); (function($){ var bt_bb_portfolio_tiles_load_images=function(root){ root.each(function(){ var page_bottom=$(window).scrollTop() + $(window).height(); $(this).find('.bt_bb_grid_item').each(function(){ var this_top=$(this).offset().top; if(this_top < page_bottom + $(window).height()){ var img_src=$(this).data('src'); if(img_src!==''&&$(this).find('.bt_bb_grid_item_post_thumbnail a').html()==''){ $(this).find('.bt_bb_grid_item_post_thumbnail a').html(''); }} }); }); } var bt_bb_portfolio_tiles_load_posts=function(root){ root.addClass('bt_bb_grid_hide'); root.find('.bt_bb_grid_item').remove(); if(root.hasClass('masonry')){ root.masonry('destroy'); } root.parent().find('.bt_bb_post_grid_loader').show(); if(root.data('post-type')=='portfolio'){ var action='bt_bb_get_tiles_portfolio'; }else{ var action='bt_bb_get_tiles_portfolio'; } var data={ 'action': action, 'number': root.data('number-portfolio'), 'format': root.data('format-portfolio'), 'category': root.data('category-portfolio'), 'show': root.data('show-portfolio'), 'bt-nonce': root.data('bt-nonce') }; $.ajax({ type: 'POST', url: ajax_object.ajax_url, data: data, async: true, success: function(response){ root.append(response); bt_bb_portfolio_tiles_resize(root); bt_bb_portfolio_tiles_load_images(root); root.masonry({ columnWidth: '.bt_bb_grid_sizer', itemSelector: '.bt_bb_grid_item', gutter: 0, percentPosition: true }); root.parent().find('.bt_bb_post_grid_loader').hide(); root.removeClass('bt_bb_grid_hide'); $('.bt_bb_grid_container').css('height', 'auto'); }, error: function(response){ root.parent().find('.bt_bb_post_grid_loader').hide(); root.removeClass('bt_bb_grid_hide'); }}); } $(document).ready(function(){ $(window).on('scroll', function(){ bt_bb_portfolio_tiles_load_images($('.bt_bb_masonry_post_grid_content')); }); $('.bt_bb_masonry_portfolio_tiles_content').each(function(){ var grid_content=$(this); bt_bb_portfolio_tiles_load_posts(grid_content); }); $('.bt_bb_masonry_portfolio_tiles_filter_item').on('click', function(){ var root=$(this).closest('.bt_bb_grid_container'); root.height(root.height()); $(this).parent().find('.bt_bb_masonry_portfolio_tiles_filter_item').removeClass('active'); $(this).addClass('active'); var grid_content=$(this).closest('.bt_bb_masonry_portfolio_tiles').find('.bt_bb_masonry_portfolio_tiles_content'); grid_content.data('category-portfolio', $(this).data('category-portfolio')); grid_content.data('format-portfolio', $(this).data('format-portfolio')); grid_content.data('post-type', $(this).data('post-type')); bt_bb_portfolio_tiles_load_posts(grid_content); }); }); $(window).ready(function(){ window.bt_bb_portfolio_tiles_resize=function(){ $('.bt_bb_masonry_post_grid_content .bt_bb_grid_item .bt_bb_grid_item_inner').each(function(){ $(this).css('height', ''); var h=Math.ceil($(this).width() * $(this).data('hw')); $(this).css('height', h); }); $('.bt_bb_masonry_post_grid_content .bt_bb_grid_item .bt_bb_grid_item_inner .bt_bb_grid_item_inner_image').each(function(){ $(this).css('height', ''); var h=Math.ceil($(this).width() * $(this).data('hw')); $(this).css('height', h); }); $('.bt_bb_masonry_post_grid_content').each(function(){ $(this).width('initial'); var child_left_margin=parseInt($(this).find('.bt_bb_masonry_post_image_content').css('margin-left')); var base_item_width=($(this).width() - child_left_margin) /($(this).data('columns')) ; if(Math.ceil(base_item_width)!=base_item_width){ $(this).width($(this).data('columns') * Math.ceil(base_item_width) + child_left_margin); }}); }}); $(window).load(function(){ bt_bb_portfolio_tiles_resize(); $('.bt_bb_masonry_post_image_content').masonry({ columnWidth: '.bt_bb_grid_sizer', itemSelector: '.bt_bb_grid_item', gutter: 0, percentPosition: true }); $(window).on('resize', function(){ bt_bb_portfolio_tiles_resize(); }); setTimeout(function(){ $('.bt_bb_masonry_post_image_content').masonry('layout'); }, 10); }); })(jQuery);